import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "",
    name: "page",
    component: () => import("../views/page.vue"),
    props: () => ({ page_id: "login" }),
  },
  {
    path: "/login",
    name: "page",
    component: () => import("../views/page.vue"),
    props: () => ({ page_id: "login" }),
  },
  {
    path: "/",
    component: () => import("../views/home.vue"),
    children: [
      {
        path: ":page_id",
        component: () => import("../views/page.vue"),
        props: ($route) => ({ page_id: $route.params.page_id }),
      },
    ],
  },
];
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
